home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / AIncludes / Fonts.a < prev    next >
Encoding:
Text File  |  1995-04-18  |  11.7 KB  |  441 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Fonts.a
  3. ;
  4. ;    Contains:    Font Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__FONTS__') = 'UNDEFINED' THEN
  21. __FONTS__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29. systemFont                        EQU        0
  30. applFont                        EQU        1
  31. newYork                            EQU        2
  32. geneva                            EQU        3
  33. monaco                            EQU        4
  34. venice                            EQU        5
  35. london                            EQU        6
  36. athens                            EQU        7
  37. sanFran                            EQU        8
  38. toronto                            EQU        9
  39. cairo                            EQU        11
  40. losAngeles                        EQU        12
  41. times                            EQU        20
  42. helvetica                        EQU        21
  43. courier                            EQU        22
  44. symbol                            EQU        23
  45. mobile                            EQU        24
  46. commandMark                        EQU        17
  47. checkMark                        EQU        18
  48. diamondMark                        EQU        19
  49.  
  50. appleMark                        EQU        20
  51. propFont                        EQU        36864
  52. prpFntH                            EQU        36865
  53. prpFntW                            EQU        36866
  54. prpFntHW                        EQU        36867
  55. fixedFont                        EQU        45056
  56. fxdFntH                            EQU        45057
  57. fxdFntW                            EQU        45058
  58. fxdFntHW                        EQU        45059
  59. fontWid                            EQU        44208
  60.  
  61. FMInput                 RECORD    0
  62. family                     ds.w   1        ; offset: $0 (0)
  63. size                     ds.w   1        ; offset: $2 (2)
  64. face                     ds.b   1        ; offset: $4 (4)
  65. needBits                 ds.b   1        ; offset: $5 (5)
  66. device                     ds.w   1        ; offset: $6 (6)
  67. numer                     ds     Point    ; offset: $8 (8)
  68. denom                     ds     Point    ; offset: $C (12)
  69. sizeof                     EQU *            ; size:   $10 (16)
  70.                         ENDR
  71.  
  72. ; typedef struct FMInput     FMInput
  73. FMOutput                 RECORD    0
  74. errNum                     ds.w   1        ; offset: $0 (0)
  75. fontHandle                 ds.l   1        ; offset: $2 (2)
  76. boldPixels                 ds.b   1        ; offset: $6 (6)
  77. italicPixels             ds.b   1        ; offset: $7 (7)
  78. ulOffset                 ds.b   1        ; offset: $8 (8)
  79. ulShadow                 ds.b   1        ; offset: $9 (9)
  80. ulThick                     ds.b   1        ; offset: $A (10)
  81. shadowPixels             ds.b   1        ; offset: $B (11)
  82. extra                     ds.b   1        ; offset: $C (12)
  83. ascent                     ds.b   1        ; offset: $D (13)
  84. descent                     ds.b   1        ; offset: $E (14)
  85. widMax                     ds.b   1        ; offset: $F (15)
  86. leading                     ds.b   1        ; offset: $10 (16)
  87. curStyle                 ds.b   1        ; offset: $11 (17)
  88. numer                     ds     Point    ; offset: $12 (18)
  89. denom                     ds     Point    ; offset: $16 (22)
  90. sizeof                     EQU *            ; size:   $1A (26)
  91.                         ENDR
  92.  
  93. ; typedef struct FMOutput     FMOutput
  94. ; typedef FMOutput             *FMOutPtr
  95. FontRec                 RECORD    0
  96. fontType                 ds.w   1        ; offset: $0 (0)        ;font type
  97. firstChar                 ds.w   1        ; offset: $2 (2)        ;ASCII code of first character
  98. lastChar                 ds.w   1        ; offset: $4 (4)        ;ASCII code of last character
  99. widMax                     ds.w   1        ; offset: $6 (6)        ;maximum character width
  100. kernMax                     ds.w   1        ; offset: $8 (8)        ;negative of maximum character kern
  101. nDescent                 ds.w   1        ; offset: $A (10)        ;negative of descent
  102. fRectWidth                 ds.w   1        ; offset: $C (12)        ;width of font rectangle
  103. fRectHeight                 ds.w   1        ; offset: $E (14)        ;height of font rectangle
  104. owTLoc                     ds.w   1        ; offset: $10 (16)        ;offset to offset/width table
  105. ascent                     ds.w   1        ; offset: $12 (18)        ;ascent
  106. descent                     ds.w   1        ; offset: $14 (20)        ;descent
  107. leading                     ds.w   1        ; offset: $16 (22)        ;leading
  108. rowWords                 ds.w   1        ; offset: $18 (24)        ;row width of bit image / 2 
  109. sizeof                     EQU *            ; size:   $1A (26)
  110.                         ENDR
  111.  
  112. ; typedef struct FontRec     FontRec
  113. FMetricRec                 RECORD    0
  114. ascent                     ds.l   1        ; offset: $0 (0)        ;base line to top
  115. descent                     ds.l   1        ; offset: $4 (4)        ;base line to bottom
  116. leading                     ds.l   1        ; offset: $8 (8)        ;leading between lines
  117. widMax                     ds.l   1        ; offset: $C (12)        ;maximum character width
  118. wTabHandle                 ds.l   1        ; offset: $10 (16)        ;handle to font width table
  119. sizeof                     EQU *            ; size:   $14 (20)
  120.                         ENDR
  121.  
  122. ; typedef struct FMetricRec  FMetricRec, *FMetricRecPtr, **FMetricRecHandle
  123. WidEntry                 RECORD    0
  124. widStyle                 ds.w   1        ; offset: $0 (0)        ;style entry applies to
  125. sizeof                     EQU *            ; size:   $2 (2)
  126.                         ENDR
  127.  
  128. ; typedef struct WidEntry     WidEntry
  129. WidTable                 RECORD    0
  130. numWidths                 ds.w   1        ; offset: $0 (0)        ;number of entries - 1
  131. sizeof                     EQU *            ; size:   $2 (2)
  132.                         ENDR
  133.  
  134. ; typedef struct WidTable     WidTable
  135. AsscEntry                 RECORD    0
  136. fontSize                 ds.w   1        ; offset: $0 (0)
  137. fontStyle                 ds.w   1        ; offset: $2 (2)
  138. fontID                     ds.w   1        ; offset: $4 (4)        ;font resource ID
  139. sizeof                     EQU *            ; size:   $6 (6)
  140.                         ENDR
  141.  
  142. ; typedef struct AsscEntry     AsscEntry
  143. FontAssoc                 RECORD    0
  144. numAssoc                 ds.w   1        ; offset: $0 (0)        ;number of entries - 1
  145. sizeof                     EQU *            ; size:   $2 (2)
  146.                         ENDR
  147.  
  148. ; typedef struct FontAssoc     FontAssoc
  149. StyleTable                 RECORD    0
  150. fontClass                 ds.w   1        ; offset: $0 (0)
  151. offset                     ds.l   1        ; offset: $2 (2)
  152. reserved                 ds.l   1        ; offset: $6 (6)
  153. indexes                     ds.b   48        ; offset: $A (10)
  154. sizeof                     EQU *            ; size:   $3A (58)
  155.                         ENDR
  156.  
  157. ; typedef struct StyleTable  StyleTable
  158. NameTable                 RECORD    0
  159. stringCount                 ds.w   1        ; offset: $0 (0)
  160. baseFontName             ds.l   64        ; offset: $2 (2)
  161. sizeof                     EQU *            ; size:   $102 (258)
  162.                         ENDR
  163.  
  164. ; typedef struct NameTable     NameTable
  165. KernPair                 RECORD    0
  166. kernFirst                 ds.b   1        ; offset: $0 (0)        ;1st character of kerned pair
  167. kernSecond                 ds.b   1        ; offset: $1 (1)        ;2nd character of kerned pair
  168. kernWidth                 ds.w   1        ; offset: $2 (2)        ;kerning in 1pt fixed format
  169. sizeof                     EQU *            ; size:   $4 (4)
  170.                         ENDR
  171.  
  172. ; typedef struct KernPair     KernPair
  173. KernEntry                 RECORD    0
  174. kernStyle                 ds.w   1        ; offset: $0 (0)        ;style the entry applies to
  175. kernLength                 ds.w   1        ; offset: $2 (2)        ;length of this entry
  176. sizeof                     EQU *            ; size:   $4 (4)
  177.                         ENDR
  178.  
  179. ; typedef struct KernEntry     KernEntry
  180. KernTable                 RECORD    0
  181. numKerns                 ds.w   1        ; offset: $0 (0)        ;number of kerning entries
  182. sizeof                     EQU *            ; size:   $2 (2)
  183.                         ENDR
  184.  
  185. ; typedef struct KernTable     KernTable
  186. WidthTable                 RECORD    0
  187. tabData                     ds.l   256        ; offset: $0 (0)        ;character widths
  188. tabFont                     ds.l   1        ; offset: $400 (1024)    ;font record used to build table
  189. sExtra                     ds.l   1        ; offset: $404 (1028)    ;space extra used for table
  190. style                     ds.l   1        ; offset: $408 (1032)    ;extra due to style
  191. fID                         ds.w   1        ; offset: $40C (1036)    ;font family ID
  192. fSize                     ds.w   1        ; offset: $40E (1038)    ;font size request
  193. face                     ds.w   1        ; offset: $410 (1040)    ;style (face) request
  194. device                     ds.w   1        ; offset: $412 (1042)    ;device requested
  195. inNumer                     ds     Point    ; offset: $414 (1044)    ;scale factors requested
  196. inDenom                     ds     Point    ; offset: $418 (1048)    ;scale factors requested
  197. aFID                     ds.w   1        ; offset: $41C (1052)    ;actual font family ID for table
  198. fHand                     ds.l   1        ; offset: $41E (1054)    ;family record used to build up table
  199. usedFam                     ds.b   1        ; offset: $422 (1058)    ;used fixed point family widths
  200. aFace                     ds.b   1        ; offset: $423 (1059)    ;actual face produced
  201. vOutput                     ds.w   1        ; offset: $424 (1060)    ;vertical scale output value
  202. hOutput                     ds.w   1        ; offset: $426 (1062)    ;horizontal scale output value
  203. vFactor                     ds.w   1        ; offset: $428 (1064)    ;vertical scale output value
  204. hFactor                     ds.w   1        ; offset: $42A (1066)    ;horizontal scale output value
  205. aSize                     ds.w   1        ; offset: $42C (1068)    ;actual size of actual font used
  206. tabSize                     ds.w   1        ; offset: $42E (1070)    ;total size of table
  207. sizeof                     EQU *            ; size:   $430 (1072)
  208.                         ENDR
  209.  
  210. ; typedef struct WidthTable  WidthTable
  211. FamRec                     RECORD    0
  212. ffFlags                     ds.w   1        ; offset: $0 (0)        ;flags for family
  213. ffFamID                     ds.w   1        ; offset: $2 (2)        ;family ID number
  214. ffFirstChar                 ds.w   1        ; offset: $4 (4)        ;ASCII code of 1st character
  215. ffLastChar                 ds.w   1        ; offset: $6 (6)        ;ASCII code of last character
  216. ffAscent                 ds.w   1        ; offset: $8 (8)        ;maximum ascent for 1pt font
  217. ffDescent                 ds.w   1        ; offset: $A (10)        ;maximum descent for 1pt font
  218. ffLeading                 ds.w   1        ; offset: $C (12)        ;maximum leading for 1pt font
  219. ffWidMax                 ds.w   1        ; offset: $E (14)        ;maximum widMax for 1pt font
  220. ffWTabOff                 ds.l   1        ; offset: $10 (16)        ;offset to width table
  221. ffKernOff                 ds.l   1        ; offset: $14 (20)        ;offset to kerning table
  222. ffStylOff                 ds.l   1        ; offset: $18 (24)        ;offset to style mapping table
  223. ffProperty                 ds.w   9        ; offset: $1C (28)        ;style property info
  224. ffIntl                     ds.w   2        ; offset: $2E (46)        ;for international use
  225. ffVersion                 ds.w   1        ; offset: $32 (50)        ;version number
  226. sizeof                     EQU *            ; size:   $34 (52)
  227.                         ENDR
  228.  
  229. ; typedef struct FamRec     FamRec
  230. ;
  231. ; pascal void InitFonts(void)
  232. ;
  233.     IF ¬ GENERATINGCFM THEN
  234.         _InitFonts:    OPWORD    $A8FE
  235.     ELSE
  236.         IMPORT_CFM_FUNCTION    InitFonts
  237.     ENDIF
  238.  
  239. ;
  240. ; pascal void GetFontName(short familyID, Str255 name)
  241. ;
  242.     IF ¬ GENERATINGCFM THEN
  243.         _GetFontName:    OPWORD    $A8FF
  244.     ELSE
  245.         IMPORT_CFM_FUNCTION    GetFontName
  246.     ENDIF
  247.  
  248. ;
  249. ; pascal void GetFNum(ConstStr255Param name, short *familyID)
  250. ;
  251.     IF ¬ GENERATINGCFM THEN
  252.         _GetFNum:    OPWORD    $A900
  253.     ELSE
  254.         IMPORT_CFM_FUNCTION    GetFNum
  255.     ENDIF
  256.  
  257. ;
  258. ; pascal Boolean RealFont(short fontNum, short size)
  259. ;
  260.     IF ¬ GENERATINGCFM THEN
  261.         _RealFont:    OPWORD    $A902
  262.     ELSE
  263.         IMPORT_CFM_FUNCTION    RealFont
  264.     ENDIF
  265.  
  266. ;
  267. ; pascal void SetFontLock(Boolean lockFlag)
  268. ;
  269.     IF ¬ GENERATINGCFM THEN
  270.         _SetFontLock:    OPWORD    $A903
  271.     ELSE
  272.         IMPORT_CFM_FUNCTION    SetFontLock
  273.     ENDIF
  274.  
  275. ;
  276. ; pascal FMOutPtr FMSwapFont(const FMInput *inRec)
  277. ;
  278.     IF ¬ GENERATINGCFM THEN
  279.         _FMSwapFont:    OPWORD    $A901
  280.     ELSE
  281.         IMPORT_CFM_FUNCTION    FMSwapFont
  282.     ENDIF
  283.  
  284. ;
  285. ; pascal void SetFScaleDisable(Boolean fscaleDisable)
  286. ;
  287.     IF ¬ GENERATINGCFM THEN
  288.         _SetFScaleDisable:    OPWORD    $A834
  289.     ELSE
  290.         IMPORT_CFM_FUNCTION    SetFScaleDisable
  291.     ENDIF
  292.  
  293. ;
  294. ; pascal void FontMetrics(FMetricRecPtr theMetrics)
  295. ;
  296.     IF ¬ GENERATINGCFM THEN
  297.         _FontMetrics:    OPWORD    $A835
  298.     ELSE
  299.         IMPORT_CFM_FUNCTION    FontMetrics
  300.     ENDIF
  301.  
  302. ;
  303. ; pascal void SetFractEnable(Boolean fractEnable)
  304. ;
  305.     IF GENERATINGCFM THEN
  306.         IMPORT_CFM_FUNCTION    SetFractEnable
  307.     ENDIF
  308.  
  309. ;
  310. ; pascal short GetDefFontSize(void)
  311. ;
  312.     IF ¬ GENERATINGCFM THEN
  313.         Macro
  314.         _GetDefFontSize
  315.             dc.w     $3EB8
  316.             dc.w     $0BA8
  317.             dc.w     $6604
  318.             dc.w     $3EBC
  319.             dc.w     $000C
  320.         EndM
  321.     ELSE
  322.         IMPORT_CFM_FUNCTION    GetDefFontSize
  323.     ENDIF
  324.  
  325. ;
  326. ; pascal Boolean IsOutline(Point numer, Point denom)
  327. ;
  328.     IF ¬ GENERATINGCFM THEN
  329.         Macro
  330.         _IsOutline
  331.             moveq    #0,d0
  332.             dc.w     $A854
  333.         EndM
  334.     ELSE
  335.         IMPORT_CFM_FUNCTION    IsOutline
  336.     ENDIF
  337.  
  338. ;
  339. ; pascal void SetOutlinePreferred(Boolean outlinePreferred)
  340. ;
  341.     IF ¬ GENERATINGCFM THEN
  342.         Macro
  343.         _SetOutlinePreferred
  344.             moveq    #1,d0
  345.             dc.w     $A854
  346.         EndM
  347.     ELSE
  348.         IMPORT_CFM_FUNCTION    SetOutlinePreferred
  349.     ENDIF
  350.  
  351. ;
  352. ; pascal Boolean GetOutlinePreferred(void)
  353. ;
  354.     IF ¬ GENERATINGCFM THEN
  355.         Macro
  356.         _GetOutlinePreferred
  357.             moveq    #9,d0
  358.             dc.w     $A854
  359.         EndM
  360.     ELSE
  361.         IMPORT_CFM_FUNCTION    GetOutlinePreferred
  362.     ENDIF
  363.  
  364. ;
  365. ; pascal OSErr OutlineMetrics(short byteCount, const void *textPtr, Point numer, Point denom, short *yMax, short *yMin, FixedPtr awArray, FixedPtr lsbArray, RectPtr boundsArray)
  366. ;
  367.     IF ¬ GENERATINGCFM THEN
  368.         Macro
  369.         _OutlineMetrics
  370.             moveq    #8,d0
  371.             dc.w     $A854
  372.         EndM
  373.     ELSE
  374.         IMPORT_CFM_FUNCTION    OutlineMetrics
  375.     ENDIF
  376.  
  377. ;
  378. ; pascal void SetPreserveGlyph(Boolean preserveGlyph)
  379. ;
  380.     IF ¬ GENERATINGCFM THEN
  381.         Macro
  382.         _SetPreserveGlyph
  383.             moveq    #10,d0
  384.             dc.w     $A854
  385.         EndM
  386.     ELSE
  387.         IMPORT_CFM_FUNCTION    SetPreserveGlyph
  388.     ENDIF
  389.  
  390. ;
  391. ; pascal Boolean GetPreserveGlyph(void)
  392. ;
  393.     IF ¬ GENERATINGCFM THEN
  394.         Macro
  395.         _GetPreserveGlyph
  396.             moveq    #11,d0
  397.             dc.w     $A854
  398.         EndM
  399.     ELSE
  400.         IMPORT_CFM_FUNCTION    GetPreserveGlyph
  401.     ENDIF
  402.  
  403. ;
  404. ; pascal OSErr FlushFonts(void)
  405. ;
  406.     IF ¬ GENERATINGCFM THEN
  407.         Macro
  408.         _FlushFonts
  409.             moveq    #12,d0
  410.             dc.w     $A854
  411.         EndM
  412.     ELSE
  413.         IMPORT_CFM_FUNCTION    FlushFonts
  414.     ENDIF
  415.  
  416. ;
  417. ; pascal short GetSysFont(void)
  418. ;
  419.     IF ¬ GENERATINGCFM THEN
  420.         Macro
  421.         GetSysFont           &dest=(sp)
  422.         move.w               $0BA6,&dest
  423.         EndM
  424.     ELSE
  425.         IMPORT_CFM_FUNCTION    GetSysFont
  426.     ENDIF
  427.  
  428. ;
  429. ; pascal short GetAppFont(void)
  430. ;
  431.     IF ¬ GENERATINGCFM THEN
  432.         Macro
  433.         GetAppFont           &dest=(sp)
  434.         move.w               $0984,&dest
  435.         EndM
  436.     ELSE
  437.         IMPORT_CFM_FUNCTION    GetAppFont
  438.     ENDIF
  439.  
  440.     ENDIF ; __FONTS__
  441.